package zz.controller;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import zz.model.Product;
import zz.model.User;
import zz.service.UserService;

@Controller  
@RequestMapping("/product") 
public class ProdController {
	    @RequestMapping("/add")  
	    public String showIndex(HttpServletRequest request,Model model){  
	    	return "addProduct";  
	    }
	    
	    @RequestMapping("/list")  
	    public String listProd(HttpServletRequest request,Model model){  
	    	return "list";  
	    }
	    @RequestMapping("/prodlist.json")
	    public @ResponseBody List<Product> getUserList() {
	    	List<Product> list=new ArrayList();
	    	Product p1=new Product();
	    	p1.setCategoryName("rr");
	    	p1.setImageThumbUrl("ff");
	    	p1.setManufacturerName("ffd");
	    	p1.setManufacturerUrl("ss");
	    	p1.setName("test");
	    	p1.setSKU("ss");
	    	p1.setStatus("Preview");
	    	list.add(p1);
	        return list;
	    } 
}
